package com.ubs.training.server.dao.model;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: xubuntu
 * Date: 8/21/12
 * Time: 5:46 AM
 * To change this template use File | Settings | File Templates.
 */
@GenericGenerator(name = "CMSTR_SEQ", strategy = "sequence",
        parameters = {@Parameter(name="sequence", value="cmstr_seq")})
@Entity(name="ratings")
public class Rating {

    @GeneratedValue(generator = "CMSTR_SEQ")
    @Id

    private int RatingID;
    private int ClientID;
    private int RatingAgencyID;
    private int CountryID;
    private Date UpdateTime;
    private String RatingValue;
    private int CountrySpecific;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Rating rating = (Rating) o;

        if (ClientID != rating.ClientID) return false;
        if (CountryID != rating.CountryID) return false;
        if (CountrySpecific != rating.CountrySpecific) return false;
        if (RatingAgencyID != rating.RatingAgencyID) return false;
        if (RatingValue != null ? !RatingValue.equals(rating.RatingValue) : rating.RatingValue != null) return false;
        if (UpdateTime != null ? !UpdateTime.equals(rating.UpdateTime) : rating.UpdateTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = ClientID;
        result = 31 * result + RatingAgencyID;
        result = 31 * result + CountryID;
        result = 31 * result + (UpdateTime != null ? UpdateTime.hashCode() : 0);
        result = 31 * result + (RatingValue != null ? RatingValue.hashCode() : 0);
        result = 31 * result + CountrySpecific;
        return result;
    }

        public int getRatingID() {
        return RatingID;
    }

    public void setRatingID(int ratingID) {
        this.RatingID = ratingID;
    }

    public int getClientID() {
        return ClientID;
    }

    public void setClientID(int clientID) {
        ClientID = clientID;
    }

    public int getRatingAgencyID() {
        return RatingAgencyID;
    }

    public void setRatingAgencyID(int ratingAgencyID) {
        RatingAgencyID = ratingAgencyID;
    }

    public int getCountryID() {
        return CountryID;
    }

    public void setCountryID(int countryID) {
        CountryID = countryID;
    }

    public Date getUpdateTime() {
        return UpdateTime;
    }

    public void setUpdateTime(Date updateTime) {
        UpdateTime = updateTime;
    }

    public String getRatingValue() {
        return RatingValue;
    }

    public void setRatingValue(String ratingValue) {
        RatingValue = ratingValue;
    }

    public int getCountrySpecific() {
        return CountrySpecific;
    }

    public void setCountrySpecific(int countrySpecific) {
        CountrySpecific = countrySpecific;
    }


}
